import request from '@/utils/request'

// 登录方法
export function loginApi(userName, userPwd, userVerifyKey, verifyCode) {
  const data = {
    userName,
    userPwd,
    userVerifyKey,
    verifyCode
  }
  return request({
    // url: '/api/Seller/SellerLogin',
    url: '/login',
    headers: {
      isToken: false,
      repeatSubmit: false
    },
    method: 'post',
    data: data
  })
}

// 注册方法
export function register(data) {
  return request({
    url: '/register',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}

// 获取用户详细信息
export function getInfoApi() {
  return request({
    // url: '/getInfo',
    url: 'http://127.0.0.1:4523/m1/2168951-538269-default/getInfo',
    method: 'get'
  })
}

// 退出方法
export function logoutApi() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

// 获取验证码
export function getCodeImgApi(UserVerifyKey) {
  return request({
    // url: '/api/Seller/GetAuthCode?UserVerifyKey=' + UserVerifyKey,
    url: '/captchaImage?UserVerifyKey=' + UserVerifyKey,
    method: 'get',
    responseType: 'arraybuffer',
    timeout: 20000
  })
}